package com.xinzhi.service.impl;

import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.xinzhi.mapper.PerformanceStateMapper;
import com.xinzhi.pojo.AppealType;
import com.xinzhi.pojo.Appraisal;
import com.xinzhi.pojo.dto.Appealaudit;
import com.xinzhi.pojo.dto.ChengjiShenHe;
import com.xinzhi.service.PerformanceStateService;
import com.xinzhi.utils.RedisUtils;
import com.xinzhi.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PerformanceStateServiceImpl implements PerformanceStateService {
    @Autowired
    protected PerformanceStateMapper performanceStateMapper;
    @Autowired
    private RedisUtils redisUtils;
    //成绩申诉审核查询接口

    @Override
    public Result Appealaudit() {
//        String Appealaudit =(String) redisUtils.get("Appealaudit");
//        if (StrUtil.isNotBlank(Appealaudit)){
//            return Result.ok(Appealaudit);
//        }
        List<ChengjiShenHe> appealaudit = performanceStateMapper.Appealaudit();
        if (appealaudit.size() > 0){
//            redisUtils.set("Appealaudit", JSONUtil.toJsonStr(appealaudit));
            return Result.ok(appealaudit);
        }else{
            return Result.error("没有数据");
        }

    }

}
